﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NUnit.Framework;
using Spring.Context;
using Spring.Context.Support;
using upcdew_20111_group2b.CapaDominio;
using upcdew_20111_group2b.CapaPersistencia;
using upcdew_20111_group2b.CapaNegocio;

namespace upcdew_20111_group2b.CapaPrueba
{
    [TestFixture]
    public class TestAdminCondominio
    {
        private IApplicationContext Spring;

        [TestFixtureSetUp]
        public void InicializarPruebas()
        {
            //"assembly://assembly/namespace/capaPersistencia.xml",
            Spring = new XmlApplicationContext(
                "assembly://upcdew-20111-group2b/upcdew_20111_group2b/CapaPersistencia.xml",
                "assembly://upcdew-20111-group2b/upcdew_20111_group2b/CapaNegocio.xml"
                );
        }

        [Test]
        public void TestCrearResidente()
        {         
            AdminCondominio admincondominio = (AdminCondominio)Spring.GetObject("adminCondominio");
            Assert.NotNull(admincondominio);
            Residente residente = null;
            Assert.DoesNotThrow(delegate
            {
                //residente = admincondominio.CrearResidente("40459127", "David Enciso", DateTime.Today, "davideus_nos@hotmail.com", "12345", "40459127", "PROPIETARIO");
            });
            Assert.NotNull(residente);            
        }

        [Test]
        public void TestCrearVivienda()
        {           
            AdminCondominio admincondominio = (AdminCondominio)Spring.GetObject("adminCondominio");
            Assert.NotNull(admincondominio);
            Vivienda vivienda = null;
            Assert.DoesNotThrow(delegate
            {
                //vivienda = admincondominio.CrearVivienda("V00001", "40459127", "AZ1", "202", "200 m2", "CASA");
            });
            Assert.NotNull(vivienda);         
        }

        [Test]
        public void TestCrearCuota_Pago()
        {            
            AdminCondominio admincondominio = (AdminCondominio)Spring.GetObject("adminCondominio");
            Assert.NotNull(admincondominio);
            Cuota_Pago cuota_pago = null;
            Assert.DoesNotThrow(delegate
            {
                //cuota_pago = admincondominio.CrearCuota_Pago("001-0000001", "V00001", "201107", 180, DateTime.Today, "Pendiente");
            });
            Assert.NotNull(cuota_pago);         
        }

        [Test]
        public void TestCrearArea_Comun()
        {        
            AdminCondominio admincondominio = (AdminCondominio)Spring.GetObject("adminCondominio");
            Assert.NotNull(admincondominio);
            Area_Comun area_comun = null;
            Assert.DoesNotThrow(delegate
            {
                //area_comun = admincondominio.CrearArea_Comun("A00001", "PISCINA", "AZ2", 15, "HABILITADO");
            });
            Assert.NotNull(area_comun);         
        }
    }
}